<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue的v-for循环2</title>
    <script src="https://cdn.bootcss.com/vue/2.5.17-beta.0/vue.min.js"></script>

</head>
<body>
<div id="app">
    <ul>
        <li v-for="(cityName,index) in cityList" :id="index" v-html="cityName"></li>
    </ul>
    <table border="1" cellpadding="1" align="center" width="500">
        <tr>
            <th>编号</th>
            <th>姓名</th>
            <th>年龄</th>
            <th>地址</th>
        </tr>
        <tr v-for="(linkman,index) in linkmanList ">
            <td v-html="index+1"></td>
            <td v-html="linkman.name"></td>
            <td v-html="linkman.age"></td>
            <td v-html="linkman.address"></td>
        </tr>
    </table>
</div>
<script type="text/javascript">
    new Vue({
        el:"#app",
        data:{
            cityList:["北京","上海","洛阳"],
            linkmanList:[
                {
                    name:"张三",
                    age:"10",
                    address:"郑州"
                },
                {
                    name:"李四",
                    age:"18",
                    address:"太原"
                },
                {
                    name:"彦卓",
                    age:"21",
                    address:"东北"
                }
            ]
        }
    });
</script>
</body>
</html>